package com.ap.generator.registermerchant;

import static com.ap.datagen.core.GeneratorHelper.buildA;
import static com.ap.datagen.core.GeneratorHelper.randomGeneratorFromEnum;
import static com.ap.datagen.core.Nullable.nullable;
import static com.ap.datagen.lang.StringRandomGeneratorBuilder.stringRandomGeneratorBuilder;
import static com.ap.generator.common.AddressMandatoryCountryCodeGeneratorBuilder.getAddressMandatoryCountryCodeGenerator;

import com.ap.core.cxf.jaxb.common.RequestTypeCode;
import com.ap.core.cxf.jaxb.managemerchant.AbstractMerchantInfoTypeGeneratorBuilder;
import com.ap.generator.common.FieldGenerator;

public class MerchantInfoTypeGeneratorBuilder extends AbstractMerchantInfoTypeGeneratorBuilder {

	@Override
	public void setupDefaults() {
		this.merchantIdGenerator = FieldGenerator.MERCHANTIDGENERATOR;
        this.merchantGroupIdGenerator = nullable(stringRandomGeneratorBuilder().alphabeticUppper().length(6).build());
        this.merchantNameGenerator = FieldGenerator.MERCHANTNAMEGENERATOR;
        this.merchantCmnNameGenerator = FieldGenerator.MERCHANTCMNNAMEGENERATOR;
        this.merchantCtgyCdGenerator = FieldGenerator.MERCHANTCATEGORYCODESGENERATOR;
        this.merchantAddressGenerator = nullable(buildA(getAddressMandatoryCountryCodeGenerator()));
        this.creditActGenerator = nullable(buildA(CreditBankAcctTypeGeneratorBuilder.getBankAcctTypeGenerator()));
        this.requestTypeGenerator = nullable(randomGeneratorFromEnum((RequestTypeCode.REGISTER)));

	}

	public static MerchantInfoTypeGeneratorBuilder getMerchantInfoTypeGenerator() {
		return new MerchantInfoTypeGeneratorBuilder();
	}

}
